package oakclub.entity;

import oakclub.global.Container;
import oakclub.service.VideoService;

import java.util.Date;

public class VideoEntity extends BaseEntity
{
    private int id;
    private UserEntity user;
    private String path;
    private Date createdTime;

    public VideoEntity()
    {

    }

    public VideoEntity(String path)
    {
        this.path = path;
    }

    public int getId()
    {
        return id;
    }

    public void setId(int id)
    {
        this.id = id;
    }

    public UserEntity getUser()
    {
        return user;
    }

    public void setUser(UserEntity user)
    {
        this.user = user;
    }

    public String getPath()
    {
        return path;
    }

    public void setPath(String path)
    {
        this.path = path;
    }

    public Date getCreatedTime()
    {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime)
    {
        this.createdTime = createdTime;
    }

    public String getUrl()
    {
        VideoService videoService = (VideoService) Container.getComponent(VideoService.class);
        return videoService.getUrl(this.path);
    }
}
